package com.qst.mq.listener;

import com.qst.domain.VipExpensesRecord;
import com.qst.dto.Result;
import com.qst.service.IVipPointsRulesService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;


@Component
public class SpringRabbitListener {

    @Resource
    private IVipPointsRulesService vipPointsRulesService;

    // 监听的队列名称，发的参数什么类型，这里就使用什么类型
    @RabbitListener(queues = "fanout.queue")
    public void listenFanoutQueue(VipExpensesRecord msg) {
//        System.out.println("接收到Fanout消息：【" + msg + "】");
        vipPointsRulesService.caluPoints(msg);
//        System.out.println(result);
    }

}